import request from "@/utils/request";
// import store from "@/store";

export const getUserApi = () =>
  request({
    url: "/v1_0/user",
    method: "get",
    // 参数是header 请求头 axios 单独的请求配置
    //所以不能用 params(get)  data (post)
    // headers: {
    //   Authorization: `Bearer ${store.state.token}`,
    // },
  });

//用户信息
export const getUserPrpfileApi = () =>
  request({
    url: "/v1_0/user/profile",
    method: "get",
    // headers: {
    //   Authorization: `Bearer ${store.state.token}`,
    // },
  });

//更新用户信息
export const updataUserProfileApi = (data) =>
  request({
    url: "/v1_0/user/profile",
    method: "patch",
    data,
  });
//更新用户头像
export const updataUserPhotoApi = (data) =>
  request({
    url: "/v1_0/user/photo",
    method: "patch",
    data,
  });
